import java.util.Scanner;//导入包

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入你的姓名：");
        String name = sc.nextLine();
        System.out.println("请输入你的年龄：");
        int age = sc.nextInt();
        System.out.println("请输入你的工资：");
        float salary = sc.nextFloat();
        System.out.println("你的信息如下：");
        System.out.println("姓名: "+name+"\n"+"年龄："+age+"\n"+"工资："+salary);
        sc.close(); // 注意, 要记得调用关闭方法
    }
    public static void main11(String[] args) {
        int n=1;
        do {
            System.out.println(n);
            n++;
        }while (n<=10);
    }
    public static void main10(String[] args) {
/*        int ret=1;
        for (int i=1;i<=5;i++){
            ret*=i;
        }
        System.out.println(ret);*/
        //计算1!+2!+3!+4!+5!的和
        int sum=0;
        for(int i=1;i<=5;i++){
            int tmp=1;
            for (int j = 1; j <= i; j++) {
                tmp*=j;
            }
            sum+=tmp;
        }
        System.out.println(sum);
    }
    public static void main9(String[] args) {
        //求出 1-100之间 所有既能被3  也能被5 整除的数字
        // 要使用break 或者continue 做
        int i=0;
        while (i<=100){
            if(i%15!=0){
                i++;
                continue;
            }
            System.out.println(i+" ");
            i++;
        }
    }
    public static void main8(String[] args) {
        //continue 的功能是跳过这次循环, 立即进入下次循环
        int i=1;
        while(i<=10){
            if(i==7) {
               continue;
            }
            //当i==7时，下面的代码就不执行了，进行到了死循环
            System.out.println(i);
            i++;
        }
    }
    public static void main7(String[] args) {

        //break 的功能是让循环提前结束.
        //找到 100 - 200 中第一个 3 的倍数
       /* int n=100;
        while (n<=200){
            if(n%3==0){
                System.out.println(n);
                break;
            }
            n++;
        }*/
        int i=1;
        while(i<=10){
            if(i==7) {
                break;
            }
            System.out.println(i);
            i++;
        }
    }
    public static void main6(String[] args) {
        //1.计算1--100的和
        /*int n=1;
        int ret=0;
        while (n<=100){
            ret+=n;
            n++;
        }
        System.out.println(ret);*/
       /* int n=1;
        int ret=1;
        while (n<=5){
            ret*=n;
            n++;
        }
        System.out.println(ret);*/
        //计算1!+2!+3!+4!+5!的和
        int n=1;
        int sum=0;
        //外部负责相加
        while(n<=5){
            int tmp=1;
            int ret=1;
            //里面负责阶乘
            while (tmp<=n){
                ret*=tmp;
                tmp++;
            }
            sum+=ret;
            n++;
        }
        System.out.println(sum);

    }
    public static void main5(String[] args) {
        int x = 1;
        int y = 1;
        switch(x) {
            case 1:
                switch (y) {
                    case 1:
                        System.out.println("hehe");
                        break;
                    case 2:
                        System.out.println("haha");
                        break;
                }
        }
    }
    public static void main4(String[] args) {
        //分支结构---switch
        //1.switch()
        //基本类型：byte、char、short、int，注意不能是long类型
        //引用类型：String常量串、枚举类型
        int a=10;
        switch (a)
        {
            //case之后必须是常量值
            case 10:
                System.out.println("a == 10");
                break;
            default:
                System.out.println("a!=10");
        }
        byte day=5;
        switch (day)
        {
            case 1:
                System.out.println("星期二");
                break;
            case 2:
                System.out.println("星期二");
                break;
            case 3:
                System.out.println("星期三");
            case 4:
                System.out.println("星期四");
                break;
            case 5:
                System.out.println("星期五");
                break;
            case 6:
                System.out.println("星期六");
                break;
            case 7:
                System.out.println("星期天");
                break;
            default:
                System.out.println("输入错误");
                break;

        }
        String s="a";
        switch (s)
        {
            case "a":
                System.out.println("a");
                break;
            case "b":
                System.out.println("b");
        }
    }
    public static void main3(String[] args) {
        int score=88;
        if(score >= 90){
            System.out.println("A");
        }else if(score < 90&&score >= 80){
            System.out.println("B");
        } else if (score >= 70 && score < 80) {
            System.out.println("C");
        } else if (score >= 60 && score < 70) {
            System.out.println("D");
        }else {
            System.out.println("E");

        }
        int x = 10;
        int y = 10;
        if (x == 10)
            if (y == 10)
                System.out.println("aaa");
            else
                System.out.println("bbb");


        }
    public static void main2(String[] args) {
        //1.if(布尔表达式)
        int score=90;
        if(score>=90){
            System.out.println("Your score is great");
        }
       /* if(1){
            System.out.println("Your score is great");
        }//error*/
        int n=2;
        if(n%2==1){
            System.out.println("n is an odd number");
        }else{
            System.out.println("n is an even number");
        }
    }
    public static void main1(String[] args) {
        //1.顺序结构
        System.out.println("aaa");
        System.out.println("bbb");
        System.out.println("ccc");
    }

}